//修正滚动事件
function addEvent(ele, type, fn, capture) {
    if (ele.addEventListener) {
        ele.addEventListener(type, fn, !!capture);
    } else if (ele.attachEvent) {
        ele.attachEvent('on' + type, fn);
    }
    return fn;
}

function addWheel(ele, fn) {
    var toBind = ('onwheel' in document || document.documentMode >= 9) ? ['wheel'] : ['mousewheel', 'DOMMouseScroll'];
    for (var i in toBind) {
        addEvent(ele, toBind[i], function(e) {
            e.delta = ('wheelDelta' in e) ? e['wheelDelta'] / 120 : ('detail' in e && e['detail'] != 0) ? -e['detail'] / 3 : -e['deltaY'] / 3;
            fn.apply(ele, arguments);
        })
    }
}
